home *** CD-ROM | disk | FTP | other *** search
Text File | 1993-05-05 | 19.4 KB | 831 lines | [RobW/RWAR] |
- # Krulockh Lord
- # By Eric L. Foley
- # *** Tournament V Titan Class Champion ***
- # (with a few updates)
-
- # Liberal commentary inserted by author
- # to explain basic philosophies for newer
- # RoboWarriors (or older ones), along with
- # another of my stories to "explain" why the
- # code's here at all . . .
-
- { From the tales of the bards, Vol. VI . . .
-
- Having defeated all comers in the Fifth
- Titan Tournament, the Krulockh Lord returned
- to the Lord of the Darkbringers with both the
- heads of his titanic enemies and the
- undisputed rulership of titanic battlefields.
- However, seeing what had happened in the
- wars with his mensch minions, the Dark Lord
- immediately decided that the technology in
- the Krulockh Lord (and thus, himself) was
- inadequate. There now existed a robot which
- could actually lead his shots with fair
- reliability, sufficient to defeat most all
- mensch that opposed him.
-
- However, a more immediate concern than
- incorporating Excelsior's aiming into his own
- designs was evident. A band of Crusaders,
- seeing how the titanic Zuper Penquin had
- failed to defeat the Krulockh Lord, and how
- its weakness might be reversed, jury-rigged
- a force of defensive robots of their own, the
- Power Penquin. Seeing that other resistance
- to the Archfiend might be stirred up, the
- Power Penquin was then sent to the Sixth
- Titanic Tournament, publishing its secrets.
- The Dark Lord, deciding that Shorshirsh could
- handle the situation himself, worried not.
- However, the vengeful and headstrong Krulockh
- Lord, angry that his courage in not competing
- with such a creature in such a forum might be
- in question, followed the Power Penquin to the
- tournament. The Dark Lord was infuriated at
- this development, for the Krulockh Lord had
- not this time received the mind blank spell
- ere he departed . . . }
-
- #############################################
- # as a result, the code:
- #############################################
-
- x 150 > Init1 Init2 ifeg
- { decide which wall is closer to get to fast}
-
- {The init sequences are generally this guy's
- weakest point of the battle, but I generally
- don't use much code to do that; all I worry
- about is getting him to the wall . . . }
-
- Init1:
- Icon0
- 10 speedx' store
- energy shield' store
- 90 aim' store
-
- InitLoop1:
- x 280 > ReadyUp ifg
- Hunt call
- InitLoop1 jump
-
- ReadyUp:
- 0 shield' store
- 0 speedy' store
- 290 x - movex' store
- y 150 > StartDown StartNorth ifeg
-
- Init2:
- Icon0
- -10 speedx' store
- energy shield' store
- 270 aim' store
-
- InitLoop2:
- x 20 < ReadyDown ifg
- Hunt call
- InitLoop2 jump
-
- ReadyDown:
- 0 shield' store
- 0 speedx' store
- 10 x - movex' store
- y 150 > StartSouth StartUp ifeg
-
- Hunt: # general search routine
- range Spray if
- aim 45 + aim' store
- range Spray if
- Collision Seek if
- aim 90 - aim' store
- range Spray if
- aim 45 + aim' store
- Collision Seek if
- return
-
- # Universal routines
-
- {This seek-and-destroy routine is the generic
- routine I use for all my collision checks.
- It's portable, it's simple (the arctan always
- starts the turret pointed straight ahead),
- and it's fairly effective. It's aso general,
- so that you don't have to write sixteen
- different collision routines depending on
- which way you're going on which wall.}
-
- Seek:
- speedx speedy arctan aim' store
- range Destroy if
- 45 aim + aim' store
- range Destroy if
- -90 aim + aim' store
- range Destroy if
- 135 aim + aim' store
- range Destroy if
- 180 aim + aim' store
- range Destroy if
- return
-
- Destroy:
- range 40 > Hold ifg
- Icon2
- 12 hellbore' store
- 150 bullet' store
- drop
- return
-
- {In almost all of my robots, I include this
- special "Hold" routine for whenever I want to
- get out of a conditional action. A simple
- line such as:
-
- (condition) Hold ifg
-
- will do the trick, and it will return the
- PC to whatever section called the jump-from
- routine. A simpler if statement can be used,
- but the Hold routine would need a drop to get
- rid of the return address, or it'll just
- go back and execute the rest of what you're
- trying to get *out* of.}
-
- Hold:
- return
-
- { This is a generic spray utility. This is
- a carry over from when the robot was
- originally designed for "mensch" opponents.
- Sprays are quite useless against any titan
- worth his salt, but the snarl in the program
- for the general-purpose shooting was tough
- enough to mull out and didn't spray often
- enough that I worried about it. Besides,
- if the robot has lost track of its opponent,
- a hellbullet won't hit its enemy likely,
- anyhow. It's still fairly effective against
- mensch (though I prefer the Jachyras' sprays
- for such). }
-
- Spray:
- sync
- range 70 > Attack ifg
- range dup 70 < and Nukem ifg
-
- Spread:
- energy 6 / p' store
- p 8 < Hold ifg
- p 2 * bullet' store
- 9 aim + aim' store
- p bullet' store
- aim 18 - aim' store
- p bullet' store
- aim 27 + aim' store
- p bullet' store
- aim 36 - aim' store
- p bullet' store
- aim 18 + aim' store
- return
-
- { Put stars on this next utility. Basic long-
- distance attack. The Krulockh Lord uses this
- to sort out its shots, and uses the deadly
- hellbullets which were an integral part of its
- victory in Tourney V. With the program snarl,
- this guy kludges this up unnecessarily, but
- in subsequent versions one would call a
- routine not unlike this directly for maximum
- effectiveness. Note also that the Krulockh
- Lord will shoot its kill shot at a fairly long
- range, 70. This will kill people at a longer
- distance but is a smidgeon less accurate than
- a closer number. The Penquin series
- uses a range of 50, Excelsior (Tourney V
- mensch champ) uses 41, and some of my other
- guys use 60. However, the sync pause is
- mandatory for accurate shooting--a close-in
- robot that's moving at a right angle will not
- be hit by an instant kill shot, and the sync
- command delays the check to make sure the
- enemy stays in the line of fire well enough
- to shoot well. Also, the Hold check here
- makes sure that the robot doesn't fire a
- useless shot that's too low of power. }
-
- Attack:
- sync
- range dup 70 < and Nukem ifg
- energy 30 < Hold ifg
- 12 hellbore' store # knock down shields
- energy bullet' store # HURT him!!!
- return
-
- Shoot:
- energy bullet' store
- return
-
- { Simple kill shot utility, with icon
- cosmetics for fun. }
-
- Nukem:
- Icon2
- 12 hellbore' store
- 150 bullet' store
- return
-
- # Movement into middle of screen
-
- { These utilities cover the movement of the
- Krulockh Lord through the center of the
- screen. If it sees an enemy along the walls
- in the course of its flight, it shoots at it
- and moves into the middle of the screen. It
- then continues on wherever it hits the next
- wall into the corner it is now heading to. }
-
- { This utility is the first one called }
-
- WallShot:
- speedx GoY GoX ife # movement shift
- range dup 70 < and Nukem if # close shot
- Attack call # if no close shot
- speedx speedy arctan d' store
- { d will save the direction for later}
- Icon0
- Transition call {go to transition proc}
-
- Determine:
-
- { This utility figures out which way to go
- once it reaches its wall. It then calls the
- right wall routine just as if it had come out
- of the corner. The shield is lowered for
- extra energy so the robot doesn't pause when
- it reaches the wall. If you change the
- speeds at which the robot leaves the walls,
- you'll have to change these comparison
- numbers. I found them out with a list of all
- possible diagonal speeds arctanned into a
- print statement for this guy during his
- development. }
-
- 0 shield' store
- d 119 = StartDown ifg
- d 60 = StartNorth ifg
- d 240 = StartSouth ifg
- d 299 = StartUp ifg
- d 150 = StartEast ifg
- d 29 = StartRight ifg
- d 209 = StartLeft ifg
- d 330 = StartWest ifg
- return
-
- GoY:
- 0 shield' store
- 150 y - 30 / speedy' store
- Cloak call
- return
-
- GoX:
- 0 shield' store
- 150 x - 30 / speedx' store
- Cloak call
- return
-
- Transition:
- Cloak call
- 45 aim' store
- range Spray if
- Collision Seek if
- 135 aim' store
- range Spray if
- d 1 > d 70 < and Check1 if
- d 91 > d 179 < and Check2 if
- Collision Seek if
- d 181 > d 269 < and Check3 if
- d 271 > d 359 < and Check4 if
- 225 aim' store
- range Spray if
- Collision Seek if
- 315 aim' store
- range Spray if
- Transition jump
-
- { This next utility is another of my generic
- all-purpose sections. I usually call it
- "Cloak," just for consistency, in my robots.
- This procedure is called throughout the
- titan's programming to keep the shield at the
- maximum level possible with existing energy
- reserves at all times, up to the stable 100
- point maximum. Note that Cloak checks its
- shield *plus* its energy for whether it's
- less than 100. If it's 100 or greater, it
- has the energy in addition to its existing shields for the job. Otherwise,
- it puts all possible energy into bolstering
- the shields, until eventually the build-up
- brings it slowly up to 100. }
-
- Cloak:
- energy shield + 100 < WimpOut if
- 100 shield' store
- return
-
- WimpOut:
- drop
- energy shield + shield' store
- return
-
- Check1:
- y 25 < YLow ifg
- x 275 > XHigh ifg
- return
-
- Check2:
- x 275 > XHigh ifg
- y 275 > YHigh ifg
- return
-
- Check3:
- y 275 > YHigh ifg
- x 25 < XLow ifg
- return
-
- Check4:
- x 25 < XLow ifg
- y 25 < YLow ifg
- return
-
- XLow:
- 0 speedx' store
- 10 x - movex' store
- drop
- Determine jump
-
- XHigh:
- 0 speedx' store
- 290 x - movex' store
- drop
- Determine jump
-
- YLow:
- 0 speedy' store
- 10 y - movey' store
- drop
- Determine jump
-
- YHigh:
- 0 speedy' store
- 290 y - movey' store
- drop
- Determine jump
-
-
- # Clockwise movement
-
- { These are the perimeter handling routines.
- The Krulockh Lord lowers its shields to get
- all available energy out for escape. This is
- a patch SINCE Tourney V; the one that won the
- tournament didn't tap its shields to get out
- of the corner, and as a result it often made a
- pause in escaping from an incoming shot. This
- results in numerous shots hitting that might
- otherwise have been dodged. The shields are
- only lowered until the wall routine calls
- Cloak again, a minimal time that I find quite
- tolerable, but such that the maximum shield
- level after the escape while still escaping
- as fast as possible is retained. }
-
- { For those confused by two nearly identical
- sets of wall routines, the "Up-Down-Left-
- Right" set deals with clockwise movement,
- while "North-South-West-East" deals with
- counter-clockwise stuff. It's a pain to keep
- track of, but you get used to it. Besides,
- things like this are necessary if the robot
- is to reach its maximum potential. }
-
- { The wall routines use a basic 0-4-45-90-135-
- 180 offset from straight ahead aim for a
- search pattern. If an enemy is spotted at
- 0, 180 (on the wall) or 4 (just off the wall)
- the robot moves into the middle of the screen}
-
- StartUp:
- Icon0
- 0 shield' store # tap into shields
- 0 speedx' store
- -7 speedy' store # get OUT of there!
-
- MainUp:
- Cloak call # shields back up again
- 0 aim' store
- range WallShot ifg
- Collision Seek if
- 4 aim' store
- range WallShot ifg
- y 25 < NorthWest ifg
- Collision Seek if
- 45 aim' store
- range Spray if
- Collision Seek if
- y 25 < NorthWest ifg
- 135 aim' store
- range Spray if
- Collision Seek if
- 90 aim' store
- range Spray if
- y 25 < NorthWest ifg
- Collision Seek if
- 180 aim' store
- range WallShot ifg
- y 25 < NorthWest ifg
- Collision Seek if
- MainUp jump
-
- StartRight:
- Icon0
- 0 shield' store
- 0 speedy' store
- 7 speedx' store
-
- MainRight:
- Cloak call
- 90 aim' store
- range WallShot ifg
- Collision Seek if
- 94 aim' store
- range WallShot ifg
- x 275 > NorthEast ifg
- Collision Seek if
- 135 aim' store
- range Spray if
- Collision Seek if
- x 275 > NorthEast ifg
- 225 aim' store
- range Spray if
- Collision Seek if
- 180 aim' store
- range Spray if
- x 275 > NorthEast ifg
- Collision Seek if
- 270 aim' store
- range WallShot ifg
- x 275 > NorthEast ifg
- Collision Seek if
- MainRight jump
-
- StartDown:
- Icon0
- 0 shield' store
- 0 speedx' store
- 7 speedy' store
-
- MainDown:
- Cloak call
- 180 aim' store
- range WallShot ifg
- Collision Seek if
- 184 aim' store
- range WallShot ifg
- y 275 > SouthEast ifg
- Collision Seek if
- 225 aim' store
- range Spray if
- Collision Seek if
- y 275 > SouthEast ifg
- 315 aim' store
- range Spray if
- Collision Seek if
- 270 aim' store
- range Spray if
- y 275 > SouthEast ifg
- Collision Seek if
- 0 aim' store
- range WallShot ifg
- y 275 > SouthEast ifg
- Collision Seek if
- MainDown jump
-
- StartLeft:
- Icon0
- 0 shield' store
- 0 speedy' store
- -7 speedx' store
-
- MainLeft:
- Cloak call
- 270 aim' store
- range WallShot ifg
- Collision Seek if
- 274 aim' store
- range WallShot ifg
- x 25 < SouthWest ifg
- Collision Seek if
- 315 aim' store
- range Spray if
- Collision Seek if
- x 25 < SouthWest ifg
- 45 aim' store
- range Spray if
- Collision Seek if
- 0 aim' store
- range Spray if
- x 25 < SouthWest ifg
- Collision Seek if
- 90 aim' store
- range WallShot ifg
- x 25 < SouthWest ifg
- Collision Seek if
- MainLeft jump
-
-
- # Counter-clockwise movement
-
- StartNorth:
- Icon0
- 0 shield' store
- 0 speedx' store
- -7 speedy' store
-
- MainNorth:
- Cloak call
- 0 aim' store
- range WallShot ifg
- Collision Seek if
- 356 aim' store
- range WallShot ifg
- y 25 < NorthEast ifg
- Collision Seek if
- 270 aim' store
- range Spray if
- Collision Seek if
- y 25 < NorthEast ifg
- 315 aim' store
- range Spray if
- Collision Seek if
- 225 aim' store
- range Spray if
- y 25 < NorthEast ifg
- Collision Seek if
- 180 aim' store
- range WallShot ifg
- y 25 < NorthEast ifg
- Collision Seek if
- MainNorth jump
-
- StartEast:
- Icon0
- 0 shield' store
- 0 speedy' store
- 7 speedx' store
-
- MainEast:
- Cloak call
- 90 aim' store
- range WallShot ifg
- Collision Seek if
- 86 aim' store
- range WallShot ifg
- x 275 > SouthEast ifg
- Collision Seek if
- 0 aim' store
- range Spray if
- Collision Seek if
- x 275 > SouthEast ifg
- 45 aim' store
- range Spray if
- Collision Seek if
- 315 aim' store
- range Spray if
- x 275 > SouthEast ifg
- Collision Seek if
- 270 aim' store
- range WallShot ifg
- x 275 > SouthEast ifg
- Collision Seek if
- MainEast jump
-
- StartSouth:
- Icon0
- 0 shield' store
- 0 speedx' store
- 7 speedy' store
-
- MainSouth:
- Cloak call
- 180 aim' store
- range WallShot ifg
- Collision Seek if
- 176 aim' store
- range WallShot ifg
- y 275 > SouthWest ifg
- Collision Seek if
- 90 aim' store
- range Spray if
- Collision Seek if
- y 275 > SouthWest ifg
- 135 aim' store
- range Spray if
- Collision Seek if
- 45 aim' store
- range Spray if
- y 275 > SouthWest ifg
- Collision Seek if
- 0 aim' store
- range WallShot ifg
- y 275 > SouthWest ifg
- Collision Seek if
- MainSouth jump
-
- StartWest:
- Icon0
- 0 shield' store
- 0 speedy' store
- -7 speedx' store
-
- MainWest:
- Cloak call
- 270 aim' store
- range WallShot ifg
- Collision Seek if
- 266 aim' store
- range WallShot ifg
- x 25 < NorthWest ifg
- Collision Seek if
- 225 aim' store
- range Spray if
- x 25 < NorthWest ifg
- Collision Seek if
- 135 aim' store
- range Spray if
- Collision Seek if
- x 25 < NorthWest ifg
- 180 aim' store
- range Spray if
- Collision Seek if
- 90 aim' store
- range WallShot ifg
- x 25 < NorthWest ifg
- Collision Seek if
- MainWest jump
-
-
- # Corner routines
-
- { These routines handle the robot's actions
- in the corners of the screen. These are
- actually among the simplest of the robot's
- tasks; the robot taps into its shields so that
- it doesn't stop a moment when it gets to the
- corner, the Cloaks up again as soon as it's
- set. The defenses on the Krulockh Lord are
- a little bit faulty, in that shots coming
- from a straight-45 degree angle don't always
- get spotted, especially in the northern
- corners. This is the result of the 0-25-65-
- 90 degree radar sweep. For some reason, the
- 25-65 part overlaps at 45 on the bottom of
- the screen, but not at the top. The Penquins
- (and the Dark Lord himself, who has evolved
- much since this guy was cloned off) use a
- 0-30-60-90 defense sweep. This leaves out the
- hole in the radar. The Krulockh's defenses
- leave the corners at a radar blip at a longer
- distance than the Penquins (100 vs. 80) , but
- he also moves out of the corners slower (7 vs.
- 9). There has to be some trade-off between
- how timid the guy will be as far as incoming
- shots, with the speed at which he actually
- escapes. Also, the Krulockh Lord also will
- run away from his own outgoing shots (except
- at 45 degrees at the top of the screen). He
- also uses a purely offensive range scan with
- completely random selection of angles; thus,
- there are no real holes in his offensive
- searching, since anything within the arena
- can eventually be spotted if it doesn't spook
- him out of the corner. }
-
- NorthWest:
- 0 shield' store # lower shields
- 0 speedx' store # stops himself
- 0 speedy' store
- 10 x - movex' store # sets himself in
- 10 y - movey' store
- Icon0
-
- NWLoop:
- Cloak call # shields go back up
- 90 aim' store
- range Attack if
- radar dup 100 < and StartSouth ifg
- 180 aim' store
- range Attack if
- radar dup 100 < and StartRight ifg
- 115 aim' store
- radar dup 100 < and StartSouth ifg
- 155 aim' store
- radar dup 100 < and StartRight ifg
- 135 aim' store
- range Spray if
- random 4 / 90 + aim' store
- range Spray if
- random 4 / 90 + aim' store
- range Spray if
- random 4 / 90 + aim' store
- range Spray if
- NWLoop jump
-
- NorthEast:
- 0 shield' store
- 0 speedx' store
- 0 speedy' store
- 290 x - movex' store
- 10 y - movey' store
- Icon0
-
- NELoop:
- Cloak call
- 270 aim' store
- range Attack if
- radar dup 100 < and StartDown ifg
- 180 aim' store
- range Attack if
- radar dup 100 < and StartWest ifg
- 205 aim' store
- radar dup 100 < and StartWest ifg
- 245 aim' store
- radar dup 100 < and StartDown ifg
- 225 aim' store
- range Spray if
- random 4 / 180 + aim' store
- range Spray if
- random 4 / 180 + aim' store
- range Spray if
- random 4 / 180 + aim' store
- range Spray if
- NELoop jump
-
- SouthEast:
- 0 shield' store
- 0 speedx' store
- 0 speedy' store
- 290 x - movex' store
- 290 y - movey' store
- Icon0
-
- SELoop:
- Cloak call
- 270 aim' store
- range Attack if
- radar dup 100 < and StartNorth ifg
- 360 aim' store
- range Attack if
- radar dup 100 < and StartLeft ifg
- 295 aim' store
- radar dup 100 < and StartNorth ifg
- 335 aim' store
- radar dup 100 < and StartLeft ifg
- 315 aim' store
- range Spray if
- random 4 / 270 + aim' store
- range Spray if
- random 4 / 270 + aim' store
- range Spray if
- random 4 / 270 + aim' store
- range Spray if
- SELoop jump
-
- SouthWest:
- 0 shield' store
- 0 speedx' store
- 0 speedy' store
- 10 x - movex' store
- 290 y - movey' store
- Icon0
-
- SWLoop:
- Cloak call
- 90 aim' store
- range Attack if
- radar dup 100 < and StartUp ifg
- 360 aim' store
- range Attack if
- radar dup 100 < and StartEast ifg
- 25 aim' store
- radar dup 100 < and StartEast ifg
- 65 aim' store
- radar dup 100 < and StartUp ifg
- 45 aim' store
- range Spray if
- random 4 / aim' store
- range Spray if
- random 4 / aim' store
- range Spray if
- random 4 / aim' store
- range Spray if
- SWLoop jump